package com.kelaite.procurement.repository;

import java.util.Date;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.kelaite.procurement.entity.TVendor;

public interface VendorRepository extends JpaRepository<TVendor, Long>{
	
	@Modifying
	@Query(value = "update t_vendor o set o.grade =:grade, o.status =:status, o.gradeFromDate =:gradeFromDate, o.gradeToDate =:gradeToDate where o.id =:id")
	public int updateVendorGrade(@Param("id") Long id,
			@Param("grade") String grade,
			@Param("status") short status,
			@Param("gradeFromDate") Date gradeFromDate,
			@Param("gradeToDate") Date gradeToDate);
	
}
